<style type="text/css">
    #table-box{
        width:900px;
/*        margin:0 auto;*/
        border:1px solid #a0a0a0;
        border-radius:10px;
        padding:10px;
    }
    #table-box td{
        padding:10px;
/*        border:1px solid #a0a0a0;*/
    }
</style>
<div class="detbox">
    <div class="dettop"></div>
    <div class="detmain">
        <?php     if(!empty($_SESSION['login']) ){ ?>
        <div id="box_ajax">
<?php


    if(!empty($_SESSION['login']) ){
        $real_path = PATH_REPO.'/'.$_SESSION['username'].'/'.$path.'/';
        $dir=@opendir($real_path);
        //echo "real_path=".$real_path.'<br>';
        $path = str_replace("/", ">>", $path);
        $here = str_replace(">>", " > ", $path);
        echo 'You are here > '.$here.'<hr>';
        echo '<table id="table-box"><tr><td style="border-bottom:1px solid #a0a0a0">File Name</td><td style="border-bottom:1px solid #a0a0a0">Last Modified</td><td style="border-bottom:1px solid #a0a0a0">File Size</td></tr>';
        while (($file = @readdir($dir)) !== false )
          {
            if(is_dir($real_path.$file)){
                if($file==".") {
                    if($path!=""){
                        $some = explode(">>", $path);
                        if(count($some)>1){
                            $panjang = strlen($some[count($some)-1]);
                            $url=substr($path, 0, strlen($path)-$panjang-2);
                            echo '<tr><td><a onclick="navigateBox(\''.BASE_URL.'\',\'<=>'.$url.'\')" href="#"><<</a></td><tr>';
                        }else{
                            echo '<tr><td><a href="'.BASE_URL.'home_con/mainbox/"><<</a></td><tr>';                            
                        }
                    }
                }
                else if($file!=".."){
                //echo "direktori: " . $file . "<br />";
                if($path!="")
                    echo '<tr><td><a onclick="navigateBox(\''.BASE_URL.'\',\'<=>'.$path.'>>'.$file.'\')" href="#">'.$file.'</a></td></tr>';
                else
                    echo '<tr><td><a onclick="navigateBox(\''.BASE_URL.'\',\'<=>'.$file.'\')" href="#">'.$file.'</a></td></tr>';
                }
            }else{
                if($real_path[strlen($real_path)-1]=="/") $real_path1 = substr($real_path, 0, strlen($real_path)-1);
                $url_download = $real_path1.$file;
                $url_download = str_replace("/", ">>", $url_download);
                //echo $real_path1.$file.'<br>';
                $file_kb = round((@filesize($real_path1.$file) / 1024), 2); // bytes to KB  
                echo '<tr><td><a href="'.BASE_URL.'home_con/download/'.$url_download.'">'.$file.'</td><td>'.date("d F Y, H:i:s", @filemtime($real_path1.$file)).'</td><td>'. $file_kb .' kb</a></td></tr>';
            }
          }
          echo '</table>';
        @closedir($dir);
    }
        
?>                    
                    </div>
                <?php } ?>
                
                <!--
<?php

/*
    if(!empty($_SESSION['login']) ){
        $real_path = PATH_REPO.$_SESSION['username'].'/'.$path.'/';
        $dir=@opendir($real_path);
        //echo "real_path=".$real_path.'<br>';
        $path = str_replace("/", ">>", $path);
        $here = str_replace(">>", " > ", $path);
        echo 'You are here > '.$here.'<hr>';
        while (($file = @readdir($dir)) !== false )
          {
            if(is_dir($real_path.$file)){
                if($file==".") {
                    if($path!=""){
                        $some = explode(">>", $path);
                        if(count($some)>1){
                            $panjang = strlen($some[count($some)-1]);
                            $url=substr($path, 0, strlen($path)-$panjang-2);
                            echo '<br><a href="'.BASE_URL.'home_con/mainbox/<=>'.$url.'"><<</a><br>';
                        }else{
                            echo '<br><a href="'.BASE_URL.'home_con/mainbox/"><<</a><br>';                            
                        }
                    }
                }
                else if($file!=".."){
                //echo "direktori: " . $file . "<br />";
                if($path!="")
                    echo '<br><a href="'.BASE_URL.'home_con/mainbox/<=>'.$path.'>>'.$file.'">'.$file.'</a>';
                else
                    echo '<br><a href="'.BASE_URL.'home_con/mainbox/<=>'.$file.'">'.$file.'</a>';
                }
            }else{
                $file_kb = round((@filesize($file) / 1024), 2); // bytes to KB  
                echo '<br><a href="'.BASE_URL.'home_con/download/'.$file.'">'.$file.' '.date("d F Y, H:i:s", @filemtime($file)).' '. $file_kb .' kb</a>';
            }
            //echo "filename: " . $file . " last modified: ".date ("d F Y, H:i:s.", filemtime($file))."<br />";
//            if($file!="." && $file!=".."){
//                if(is_dir($path.$username."/".$file)){
//                    echo "<a href='direktorihandler.php?rt=".$file."'>Direktori : ".$file."</a><br/>";
//                }
//                else{
//                    echo "<a href='".$path.$username."/".$file."' target='blank'>File : " . $file . "</a><br />";
//                }
//            }
          }
        @closedir($dir);
    }
        */
?>-->
            </div>
            <div class="detbot"></div>
        </div>
